package BS.servlet;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;

import com.alibaba.fastjson.JSON;

import BS.dao.caozuoyuanDao;
import BS.dao.daofactory;
import BS.dao.gdzcDao;
import BS.dao.guanliyuanDao;
import BS.dao.wbwDao;
import BS.entity.caozuoyuan;
import BS.entity.gdzc;
import BS.entity.guanliyuan;
import BS.utils.md5;

@WebServlet("/updateStatus")
public class UpdateStatusServlet extends HttpServlet {

	@SuppressWarnings("unused")
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException {
		String id = request.getParameter("id");
		String type = request.getParameter("type");
		try {
			//type = (type.equals("1")) ? "0" : "1";
			new wbwDao().updateStatus(Integer.valueOf(id), Integer.valueOf(type));
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		resp.setContentType("text/html;charset=utf-8");
		String infoString = JSON.toJSONString("");
		resp.getWriter().write(infoString);
	}

}
